import service from '../utils/request'
import Api from "./serviceApi";

export function login(data: any){
    return service({
        url: Api.common.login,
        method: 'post',
        headers:{
            "Content-Type":"application/json;charset-utf-8" //设置一下请求头
        },
        data
    })
}

export function register(data: any){
    return service({
        url: Api.common.register,
        method: 'post',
        headers:{
            "Content-Type":"application/json;charset-utf-8" //设置一下请求头
        },
        data
    })
}

export function sendCode(data: any){
    return service({
        url: Api.common.sendCode,
        method: 'get',
        params:data
    })
}

export function getUserAccount(data: any){
    return service({
        url: Api.common.getUserAccount,
        method: 'get',
        params:data
    })
}

export function getOnLinePerPon(){
    return service({
        url: Api.common.getOnLinePerPon,
        method: 'get'
    })
}

export function modifyPassword(data: any){
    return service({
        url: Api.common.modifyPassword,
        method: 'post',
        headers:{
            "Content-Type":"application/json;charset-utf-8" //设置一下请求头
        },
        data
    })
}

export function setAvatar(data: any){
    return service({
        url: Api.common.setAvatar,
        method: 'post',
        params: data
    })
}

export function setName(data: any){
    return service({
        url: Api.common.setName,
        method: 'post',
        params: data
    })
}

export function getPromise(){
    return service({
        url: Api.common.getPromise,
        method: 'get',
    })
}

export function setPromise(data: any){
    return service({
        url: Api.common.setPromise,
        method: 'post',
        headers:{
            "Content-Type":"application/json;charset-utf-8" //设置一下请求头
        },
        data
    })
}

export function ping(data: any){
    return service({
        url: Api.common.ping,
        method: 'get',
        headers:{
            "Content-Type":"application/json;charset-utf-8" //设置一下请求头
        },
        data
    })
}
